/*
 * author  : Ramesh Ramaswamy
 * email   : ramesh.ramaswamy@hotmail.com
 * created : 21 sepetember 2014
 *
 * info    : microcontroller needs a filesystem based on datastructure
 *         : which is fast and works with ROM and RAM storage.
 *
 */

#ifndef __EFS_CORE_H__
#define __EFS_CORE_H__

/*
 * how do we store ascii letters?
 * 2 ^ 5 = 32, is enough, remaining 3 bits (7 ) combination
 * 0 - ascii 32 - 63
 * 1 - ascii 64 - 95
 * 2 - ascii 96 - 127
 * 3 - date
 * 4 - month
 * 5 - year ( 2014+ )
 * 6 - extension
 * 7 - reserved
 */
typedef struct {
	unsigned long long filename;
	unsigned char extension;
	unsigned char date;
	unsigned char month;
	unsigned char year;
	unsigned int size;
	unsigned int offset;
} efs_object;

typedef struct {
	unsigned int magic_id : 12;
	unsigned int attributes : 4; 
	unsigned int version : 16;
	unsigned int app_version : 16;
	unsigned int reserved : 16;
} efs;

#endif /* __EFS_CORE_H__ */
